<script>
import { defineComponent, reactive, ref } from 'vue'

import { DatePicker } from 'ant-design-vue'

export default defineComponent({
  components: {
    DatePicker,
  },
  props: {
    params: Object,
  },
  setup(props) {
    const value = ref(props.params?.value ?? '')
    const row = reactive(props.params.data)
    const getValue = () => row.process_name
    const handleSelectChange = () => {
      row.purchaseDate = value.value // 更新ID
      // props.params.api.stopEditing()
      // props.params.node.setExpanded(true)
    }
    return {
      value,
      row,
      getValue,
      handleSelectChange,
    }
  },
})
</script>

<template>
  <div style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center">
    <DatePicker v-model:value="value" style="width: 100%; height: 100%" placeholder="请选择交货日期" :filter-option="false" @change="handleSelectChange" />
  </div>
</template>

<style scoped>
input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
</style>
